# Ratings: <strong><%= sideffect[:total] || 0 %></strong> &nbsp;&nbsp;&nbsp;
# Sideffects: <strong><%= sideffect[:sideffects].length %></strong> 
<table  border="1" width="100%">
  <tr>
    <th style="background:#87a2a3;"><%= link_to_remote("Sideffect", :update => "drug#{sideffect[:drug].id}_sideffects", :url => {:action => "sort_by_sideffect", :id => sideffect[:drug].id}) %></th>
    <th style="background:#87a2a3;"><%= link_to_remote("Frequency", :update => "drug#{sideffect[:drug].id}_sideffects", :url => {:action => "sort_by_frequency", :id => sideffect[:drug].id})%></th>
    <th style="background:#87a2a3;"><%= link_to_remote("Tolerance Score", :update => "drug#{sideffect[:drug].id}_sideffects", :url => {:action => "sort_by_tolerance", :id => sideffect[:drug].id})%></th>
  </tr>
  <%count=0%>
  <% sideffect[:sideffects].each do |sf| %>
    <%if count%2==0%>   
      <%color="#ffffff"%>
    <%else%>
      <%color="#cae8ea"%>
    <% end%>
      <tr>
        <td align="center" style="background:<%= color%>;"><strong><%= h(sf["name"]) %></strong></td>
        <td style="background:<%= color%>;"><strong><%= sprintf("%2.2f", 100 * sf["cnt"].to_f / sideffect[:total].to_f) + "%" %></strong></td>
        <td style="background:<%= color%>;"><strong><%= sprintf("%2.1f", sf["tolerance"].to_f)%></strong></td>
    </tr>
    <%count+=1%>
  <% end %>
</table>
